Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CloseAsync_ByServer_AcceptThrows quic test #56355

Merged

Conversation

wfurt
Copy link
Member

@wfurt wfurt commented Jul 27, 2021

this was last disabled test from #49157 mega issue.

The problem with the test is that RunClientServer runs client and server as two independent task without synchronization on connection establishment.

So the Accept on server can finish and it would call serverConnection.CloseAsync()
Than depending on timing, the ConnectAsync() on client can blow up (even if the test does not have any client hook)

     System.Net.Quic.QuicException : Connection has been shutdown by transport. Error Code: USER_CANCELED
      Stack Trace:
        /home/furt/github/wfurt-runtime/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs(256,0): at System.Net.Quic.Implementations.MsQuic.MsQuicConnection.HandleEventShutdownInitiatedByTransport(State state, ConnectionEvent& connectionEvent)
        /home/furt/github/wfurt-runtime/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs(675,0): at System.Net.Quic.Implementations.MsQuic.MsQuicConnection.NativeCallbackHandler(IntPtr connection, IntPtr context, ConnectionEvent& connectionEvent)
        --- End of stack trace from previous location ---
        /home/furt/github/wfurt-runtime/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestBase.cs(149,0): at System.Net.Quic.Tests.QuicTestBase`1.<>c__DisplayClass29_0.<<RunClientServer>b__1>d.MoveNext()

To fix that I use new helper function that would first establish connection and then run the actual test.

fixes #49157

@ghost
Copy link

ghost commented Jul 27, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

this was last disabled test from #49157 mega issue.

The problem with the test is that RunClientServer runs client and server as two independent task without synchronization on connection establishment.

So the Accept on server can finish and it would call serverConnection.CloseAsync()
Than depending on timing, the ConnectAsync() on client can blow up (even if the test does not have any client hook)

     System.Net.Quic.QuicException : Connection has been shutdown by transport. Error Code: USER_CANCELED
      Stack Trace:
        /home/furt/github/wfurt-runtime/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs(256,0): at System.Net.Quic.Implementations.MsQuic.MsQuicConnection.HandleEventShutdownInitiatedByTransport(State state, ConnectionEvent& connectionEvent)
        /home/furt/github/wfurt-runtime/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs(675,0): at System.Net.Quic.Implementations.MsQuic.MsQuicConnection.NativeCallbackHandler(IntPtr connection, IntPtr context, ConnectionEvent& connectionEvent)
        --- End of stack trace from previous location ---
        /home/furt/github/wfurt-runtime/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestBase.cs(149,0): at System.Net.Quic.Tests.QuicTestBase`1.<>c__DisplayClass29_0.<<RunClientServer>b__1>d.MoveNext()

To fix that I use new helper function that would first establish connection and then run the actual test.

fixes #49157

Author: wfurt
Assignees: wfurt
Labels:

area-System.Net.Quic

Milestone: -

@stephentoub stephentoub merged commit a61bc64 into dotnet:main Jul 27, 2021
@karelz karelz added this to the 6.0.0 milestone Jul 29, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QUIC] Test failures
3 participants